package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.quest.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    int selectForCount(EmployeeQueryObject qo);

    List<Employee> selectForList(EmployeeQueryObject qo);

    void insertRole(@Param("emp") Employee emp, @Param("ids") Long[] ids);

    void deleteRole(Employee emp);

    Employee login(@Param("username") String username, @Param("password") String password);

    void updatePwd(@Param("id") Long id, @Param("newPassword") String newPassword);
     /*
           员工的批量删除
      */
    void delectBatch(Long[] ids);
      /*
            通过用户名查找对象
       */
    Employee SelectEmployeeByName(String name);

    /*
   更改用户的状态,禁用账号
*/
    void updataStatus(@Param("id") Long id,@Param("status") boolean status);

    Employee selectById(Long id);

    List<Employee> selRolesBySn(String[] sn);

}